<template>
	<div class="p_20">
		<el-dialog :visible="isShow" @close="closeDialog" :close-on-click-modal="false">
			<el-divider></el-divider>
			<el-form label-width="120px">
				<el-form-item label="姓名">
					<el-input v-model.trim="form.realname" size="small"></el-input>
				</el-form-item>
				
				<el-form-item label="账号">
					<el-input v-model.trim="form.username" size="small"></el-input>
				</el-form-item>
				
				<el-form-item label="角色">
					<el-select v-model="form.role_ids" size="small">
						<el-option v-for="item in role" :label="item.name" :value="item.id" :key="item.id"></el-option>
					</el-select>
				</el-form-item>
				
				<el-form-item label="密码">
					<el-input v-model.trim="form.password" size="small" placeholder="不填写默认为不修改密码"></el-input>
				</el-form-item>
				
				<el-form-item label="确认密码">
					<el-input v-model.trim="form.password_confirm" size="small" placeholder="不填写默认为不修改密码"></el-input>
				</el-form-item>
				
				<el-form-item label="状态">
					<el-switch v-model="form.state" active-value="1" inactive-value="0" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
				</el-form-item>
				
				<el-form-item>
					<el-button size="small" type="primary" @click="submit">提交</el-button>
					<el-button size="small" @click="closeDialog">取消</el-button>
				</el-form-item>
			</el-form>
		</el-dialog>
		
		
		<!-- <el-page-header @back="goBack" content="编辑"></el-page-header>
		<el-divider></el-divider>
		<el-form label-width="120px">
			<el-row>
				<el-col :span="8">
					<el-form-item label="姓名">
						<el-input v-model.trim="form.realname" size="small"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="8">
					<el-form-item label="账号">
						<el-input v-model.trim="form.username" size="small"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="8">
					<el-form-item label="角色">
						<el-select v-model="form.role_ids" size="small">
							<el-option v-for="item in role" :label="item.name" :value="item.id" :key="item.id"></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="8">
					<el-form-item label="密码">
						<el-input v-model.trim="form.password" size="small" placeholder="不填写默认为不修改密码"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="8">
					<el-form-item label="确认密码">
						<el-input v-model.trim="form.password_confirm" size="small" placeholder="不填写默认为不修改密码"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="8">
					<el-form-item label="状态">
						<el-switch v-model="form.state" active-value="1" inactive-value="0" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
					</el-form-item>
				</el-col>
			</el-row>
			<el-form-item>
				<el-button size="small" type="primary" @click="submit">提交</el-button>
				<el-button size="small" @click="goBack">取消</el-button>
			</el-form-item>
		</el-form> -->
	</div>
</template>

<script>
	import methods from "./method";
	import data from "./data";
	// import E from "wangeditor";

	export default {
		data() {
			return data.init();
		},
		methods: methods,
		mounted() {
			// this.getRole();
			//获取人力资源id
			// console.log(this.$route.params == {});
			
		}
	};
</script>

<style>
	.avatar-uploader .el-upload {
		border: 1px dashed #d9d9d9;
		border-radius: 6px;
		cursor: pointer;
		position: relative;
		overflow: hidden;
	}

	.avatar-uploader .el-upload:hover {
		border-color: #409eff;
	}

	.avatar-uploader-icon {
		font-size: 28px;
		color: #8c939d;
		width: 178px;
		height: 178px;
		line-height: 178px;
		text-align: center;
	}

	.avatar {
		width: 178px;
		height: 178px;
		display: block;
	}
</style>
